<?php
/**
 * JoiGallery - image gallery component for Joostina
 *
 * Добавление фотографии
 *
 * @version 1.0 alpha 12
 * @package JoiGallery
 * @subpackage	AdminView
 * @filename item_add.php
 * @author JoostinaTeam
 * @copyright (C) 2008-2009 Joostina Team
 * @license see license.txt
 *
 **/
 
defined('_VALID_MOS') or die();

mosCommonHTML::loadOverlib();

?>

<script language="javascript" type="text/javascript">
  function submitbutton(pressbutton, section) {
    var form = document.adminForm;
    if (pressbutton == 'cancel') {
            submitform( pressbutton );
            return;
    }
    <?php getEditorContents( 'editor1', 'description' ) ; ?>
    submitform(pressbutton);
  }
</script>

<table class="adminheading">
  <tr>
    <th class="config">
     <?php echo _C_JOIGALLERY_COMPONENT;
           echo _C_JOIGALLERY_PHOTO_UP_PHOTO;
      ?>
    </th>
  </tr>
</table>

<form action="index2.php" method="post" name="adminForm" enctype="multipart/form-data">

  <div align="left" class="small">
    <?php echo sprintf(_C_JOIGALLERY_PHOTO_UP_LIMIT, ini_get('upload_max_filesize')).'<br/>'
              .sprintf(_C_JOIGALLERY_PHOTO_UP_LIMIT_TIME, ini_get('max_execution_time')); ?> 
  </div>

  <table class="adminform">
    <tr>
     <td colspan="2">&nbsp;</td>
    </tr>
    <tr>
      <td width="150" class="pl20"><?php echo _C_JOIGALLERY_PHOTO_PLACE_CAT ?></td>
      <td><?php echo $lists['cid']; ?></td>
    </tr>
    <tr>
      <td class="pl20"><?php echo _C_JOIGALLERY_PHOTO_SORT ?></td>
      <td><?php echo $lists['sort']; ?></td>
    </tr>
    <tr>
     <td colspan="2">&nbsp;</td>
    </tr>
    <tr>
      <td class="pl20"><?php echo _C_JOIGALLERY_PHOTO_DEFAULT_PUB ?></td>
      <td><?php echo mosHTML::yesnoRadioList('state', '', 1); ?></td>
    </tr>
    <tr>
      <td class="pl20"><?php echo _C_JOIGALLERY_NAME ?> <?php echo mosToolTip(_C_JOIGALLERY_JS_EMPTY, _HELP); ?></td>
      <td><input type="text" name="name" class="text_area" size="30" value="" /></td>
    </tr>
    <tr>
     <td colspan="2">&nbsp;</td>
    </tr>
    <tr valign="top">
      <td class="pl20"><?php echo _C_JOIGALLERY_DESCRIPTION ?></td>
      <td>
        <?php // parameters : areaname, content, hidden field, width, height, rows, cols
          editorArea( 'editor1',  '' , 'description', '100%;', '300', '60', '20' ) ;
        ?>
      </td>
    </tr>
    <tr>
      <td colspan="2">&nbsp;</td>
    </tr>    
    <tr>
      <td>&nbsp;</td>
      <td class="title gray"><?php echo _C_JOIGALLERY_PHOTO_UP_WAYS_ONE ?></td>
    </tr>
    <tr>
      <td width="150" class="pl20 "><?php echo _C_JOIGALLERY_PHOTO_FILE ?></td>
      <td><input type="file" name="photo" class="text_area" size="30" value="" /></td>
    </tr>
    <tr>
     <td colspan="2">&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td class="title gray" colspan="2"><?php echo _C_JOIGALLERY_PHOTO_UP_WAYS_TWO ?></td>
    </tr>
    <tr>
      <td width="150" class="pl20"><?php echo _C_JOIGALLERY_UPLOAD_ARCHIVE ?></td>
      <td><input type="file" name="zip" class="text_area" size="30" value="" /></td>
    </tr>
    <tr>
     <td colspan="2">&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td class="title gray"><?php echo _C_JOIGALLERY_PHOTO_UP_WAYS_THREE ?></td>
    </tr>
    <tr>
      <td width="150" class="pl20"><?php echo _C_JOIGALLERY_PHOTO_DIRECTORY ?></td>
      <td><input type="name" name="dir" class="text_area" size="45" value="<?php echo JPATH_BASE; ?>" /></td>
    </tr>
    <tr>
     <td colspan="2">&nbsp;</td>
    </tr>
  </table>

  
  <!--<tr>TODO: Сделать загрузку изображение и zip-архив через одну форму
    <th class="title" colspan="2">Изображение или zip-архив</th>
  </tr>
  <tr>
    <td width="150">--><?php //echo _C_JOIGALLERY_PHOTO_FILE ?><!--</td>
    <td><input type="file" name="photo_or_zip" class="text_area" size="30" value="" /></td>
  </tr>-->


  <input type="hidden" name="option" value="<?php echo $option; ?>" />
  <input type="hidden" name="task" value="" />
  <input type="hidden" name="act" value="photos" />
  <input type="hidden" name="boxchecked" value="0" />
  <input type="hidden" name="hidemainmenu" value="0" />
</form>